Optimal. Leaf size=191 \[ -\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {(-9 B+7 i A) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (B+i A) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.55, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.132, Rules used = {3596, 3598, 12, 3544, 205} \[ -\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {(-9 B+7 i A) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (B+i A) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 205
Rule 3544
Rule 3596
Rule 3598
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}} \, dx &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {\int \frac {\sqrt {a+i a \tan (c+d x)} \left (\frac {1}{2} a (5 A+3 i B)-2 a (i A-B) \tan (c+d x)\right )}{\tan ^{\frac {5}{2}}(c+d x)} \, dx}{a^2}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {2 \int \frac {\sqrt {a+i a \tan (c+d x)} \left (-\frac {1}{4} a^2 (7 i A-9 B)-\frac {1}{2} a^2 (5 A+3 i B) \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx}{3 a^3}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {4 \int -\frac {3 a^3 (A-i B) \sqrt {a+i a \tan (c+d x)}}{8 \sqrt {\tan (c+d x)}} \, dx}{3 a^4}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}-\frac {(A-i B) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx}{2 a}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {(a (i A+B)) \operatorname {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 4.31, size = 221, normalized size = 1.16 \[ \frac {e^{-i (c+d x)} (A+B \tan (c+d x)) \left (3 (B+i A) e^{i (c+d x)} \left (-1+e^{2 i (c+d x)}\right )^{3/2} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right )+i A \left (-18 e^{2 i (c+d x)}+7 e^{4 i (c+d x)}+3\right )-3 B \left (-6 e^{2 i (c+d x)}+5 e^{4 i (c+d x)}+1\right )\right )}{6 d \left (-1+e^{2 i (c+d x)}\right ) \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)} (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.73, size = 518, normalized size = 2.71 \[ -\frac {\sqrt {2} {\left (2 \, {\left (7 \, A + 15 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, {\left (11 \, A + 3 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 30 \, {\left (A + i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, A + 6 i \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} + 3 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} \log \left (\frac {i \, a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) - 3 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} \log \left (\frac {-i \, a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right )}{12 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {B \tan \left (d x + c\right ) + A}{\sqrt {i \, a \tan \left (d x + c\right ) + a} \tan \left (d x + c\right )^{\frac {5}{2}}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.36, size = 746, normalized size = 3.91 \[ \frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (-3 i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{2}\left (d x +c \right )\right ) a -36 B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{3}\left (d x +c \right )\right )-6 i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{3}\left (d x +c \right )\right ) a +3 B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{4}\left (d x +c \right )\right ) a +36 A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+28 i A \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \left (\tan ^{3}\left (d x +c \right )\right )+60 i B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+6 A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{3}\left (d x +c \right )\right ) a +3 i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{4}\left (d x +c \right )\right ) a -3 B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{2}\left (d x +c \right )\right ) a +24 B \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \tan \left (d x +c \right )+8 A \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\right )}{12 d a \tan \left (d x +c \right )^{\frac {3}{2}} \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \left (-\tan \left (d x +c \right )+i\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {A + B \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \tan ^{\frac {5}{2}}{\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________